import e from "./stage_ctrl";
import t from "./assets_loader";
import n from "./section_cell";
import r from "./section_head";
import i from "./section_naying";
import s from "./section_jay";
import o from "./section_wangfeng";
import u from "./section_harlern";
import a from "./section_bottom";
import f from "./section_footer";
import l from "./section_top";
import p from "./event_center";
import d from "./url_util";

export default class VoiceOfChina extends e {
  constructor() {
    super();
    t.threadsCount = 1;
  }
  loadAssets(t) {
    let n = this;
    // t.push("text|http://voc.bungba.com/dev/php/voc/pv.php", "text|http://voc.bungba.com/dev/php/voc/like_count.php"),
    e.prototype.loadAssets.call(n, t);
  }
  pageBox = null;
  cells = null;
  onViewControllerPrepared() {
    let e = this;
    // v.pvCount = parseInt(t.asset("http://voc.bungba.com/dev/php/voc/pv.php"), 10),
    // v.likeCount = parseInt(t.asset("http://voc.bungba.com/dev/php/voc/like_count.php"), 10);
    let c = e.view().subViewByName("cell_views");
    c.remove(),
      (e.cells = []),
      e.cells.push(
        new l(c.subViewByIndex(0)),
        new r(c.subViewByIndex(1)),
        new n(c.subViewByIndex(2)),
        new n(c.subViewByIndex(3)),
        new s(c.subViewByIndex(4)),
        new n(c.subViewByIndex(5)),
        new i(c.subViewByIndex(6)),
        new n(c.subViewByIndex(7)),
        new o(c.subViewByIndex(8)),
        new n(c.subViewByIndex(9)),
        new u(c.subViewByIndex(10)),
        new n(c.subViewByIndex(11)),
        new n(c.subViewByIndex(12)),
        new a(c.subViewByIndex(13)),
        new f(c.subViewByIndex(14))
      ),
      (e.pageBox = e.view().subViewByName("page_box")),
      e.pageBox.dataSource(e),
      e.pageBox.reloadData();
  }
  onViewResize(e, t) {
    let n = this;
    if (n.prepared) {
      n.view().width(e),
        n.view().height(t),
        n.pageBox.height(t),
        n.pageBox.width(e);
      for (let r = 0; r < n.cells.length; r++) {
        let i = n.cells[r].view(),
          s = e / i.width();
        i.scaleX(s), i.scaleY(s);
      }
      n.pageBox.reloadData();
    }
  }
  isVertical(e) {
    return !0;
  }
  cellCount(e) {
    let t = this;
    return t.cells.length;
  }
  cellSizeByIndex(e, t) {
    let n = this;
    return n.cells[t].view().height() * n.cells[t].view().scaleY();
  }
  cellByIndex(e, t) {
    let n = this;
    return n.cells[t].view();
  }
  onWechatShared() {
    // window["_hmt"] != undefined && _hmt.push(["_trackEvent", "SHAREING", "SHARING", "SHARING"])
  }
}
